package cn.wolfcode.shop.activemq.produce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;
import javax.jms.Destination;
/*
    ActiveMQ
    订单生产者
 */
@Component
public class OrderProduce {
    @Autowired
    private JmsTemplate jmsTemplate;
    @Autowired
    private Destination orderQueue;//生产订单消息的目的地

    /**
     * 发布生成订单的队列消息
     * @param content
     */
    public void publishOrderQueueMsg(String content){
        jmsTemplate.convertAndSend(orderQueue,content);
    }
}
